<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/template-web.js"></script>
    <script src="./js/zepto/zepto.min.js"></script>
</head>
<body>
        <div>
                <ul class="ulbox">
                    <!-- <li>
                        <span>id</span>
                        <span>name</span>
        
                    </li> --> 
                </ul>
            </div>
        
            <script type="html/text" id='tmp'>
                {{each rows value index}}
                    <li>
                                <span>{{value.id}}</span>
                                <span>{{value.name}}</span>
        
                     </li>
            
                {{/each}}
            </script>
    <script>
        var obj = {
            name:'张三',
            rows:[{name:'张三',id:1},{name:'张三',id=2},{name:'张三',id=3}]
        }
        var htmls = template('tmp',obj)
        $('ulbox').html(htmls)
        
    </script>
</body>
</html>